CID
1128566
If an image source page is allocated in kimage_alloc_page() but the
machine_kexec_add_page() fails, the image may appear to load
succesfully but it will not execute. The relocation will fault
(rebooting the host) when trying to copy the source page, as it is not
mapped.
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
*/
struct page_info *page;
paddr_t addr;
+ int ret;
/*
* Walk through the list of destination pages, and see if I have a
}
}
found:
- machine_kexec_add_page(image, page_to_maddr(page), page_to_maddr(page));
+ ret = machine_kexec_add_page(image, page_to_maddr(page),
+ page_to_maddr(page));
+ if ( ret < 0 )
+ {
+ free_domheap_page(page);
+ return NULL;
+ }
return page;
}